package com.vic.mvc.prepare.design.proxy.dynamic;

import java.lang.reflect.Proxy;

import com.vic.mvc.prepare.design.proxy.Car;
import com.vic.mvc.prepare.design.proxy.MoveAble;

public class Test {
	public static void main(String[] args) {
		Car c = new Car();
		LogHanlder l = new LogHanlder(c);
		TimeHandler t = new TimeHandler(c);
		MoveAble m = (MoveAble) Proxy.newProxyInstance(c.getClass().getClassLoader(), c.getClass().getInterfaces(), 
				l);
		m.move();
		MoveAble m2 = (MoveAble) Proxy.newProxyInstance(c.getClass().getClassLoader(), c.getClass().getInterfaces(), 
				t);
		m2.move();
	}
}
